#include<bits/stdc++.h>
#define int long long
using namespace std;

int arr[100005];
bool vis[100005];
bool alive[100005];

void solve(){
    int n;
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> arr[i];
    }
    sort(arr+1,arr+n+1);
    memset(vis,0,sizeof(vis));
    int ans = 999999;
    for(int i=1;i<n;i++){
        for(int j=i+1;j<=n;j++){
            if(alive[i] || alive[j] || vis[j]){
                continue;
            }
            if(arr[i] == arr[j])continue;
            alive[i] = true;
            vis[j] = true;
            bool flag = true;
            int cnt = 0;
            for(int k=1;k<=n;k++){
                if(!alive[k]){
                    if(!vis[k]){
                        flag = false;
                        break;
                    }
                }
            }
            if(flag){
                for(int k=1;k<=n;k++){
                    if(!alive[k]){
                        cnt++;
                    }
                }
                ans = min(ans,cnt);
            }
        }

    }
    cout << ans << endl;
}

signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();
    return 0;
}















